//
//  ACCacheConfiguration.h
//  ACCache_Example
//
//  Created by autohome on 2021/8/10.
//  Copyright © 2021 CaiXiang. All rights reserved.
//

#import <Foundation/Foundation.h>

typedef NS_OPTIONS(NSUInteger, ACCachePolicy) {
    ACCachePolicyAll = 1 << 0,
    ACCachePolicyMemory = 1 << 1,
    ACCachePolicyDisk = 1 << 2,
};

NS_ASSUME_NONNULL_BEGIN

@interface ACCacheConfiguration : NSObject

/// 默认缓存配置
@property (nonatomic, class, readonly, nonnull) ACCacheConfiguration *defaultCacheConfig;

/// 当收到内存警告的时候是否需要移除所有内存缓存对象
///
/// 默认 YES
@property (assign, nonatomic) BOOL shouldRemoveAllObjectsOnMemoryWarning;

/// 当进入后台的时候是否需要移除所有内存缓存对象
///
/// 默认 YES
@property (assign, nonatomic) BOOL shouldRemoveAllObjectsWhenEnteringBackground;

/// 内存缓存的限制数
///
/// 只在ACCachePolicy 为 ACCachePolicyAll | ACCachePolicyMemory 时有效
@property (assign, nonatomic) NSInteger memoryCountLimit;

/// 内存缓存的限制数
///
/// 只在ACCachePolicy 为 ACCachePolicyAll | ACCachePolicyMemory 时有效
@property (assign, nonatomic) NSInteger memoryCostLimit;

/// 插件名称
///
/// 对ACCache进行插件化管理，每个插件调用该方法创建当前插件的ACCache对象，实现数据隔离和提速
@property (copy, nonatomic) NSString *pluginName;

/// 对应插件下的缓存的名字
@property (copy, nonatomic) NSString *name;

/// 缓存的模式
///
/// 默认是内存缓存
@property (assign, nonatomic) ACCachePolicy cacheType;

/// 缓存有效时长,单位秒
@property (nonatomic, assign) NSTimeInterval effectiveCacheTime;

@end

NS_ASSUME_NONNULL_END
